<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/taglibs.jsp"%>

<form action="${ctx}/sys/org/add" method="post">
    <table>
        <tbody>
            <tr>
                <td><label for="addform-id">组织ID</label></td>
                <td><input type="text" id="addform-id" name="id" class="easyui-textbox"
                        data-options="validType:'length[0,32]', prompt:'不输入时会自动生成'"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-orgType">组织类型</label></td>
                <td><input type="text" id="addform-orgType" name="orgType" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-name">组织名</label></td>
                <td><input type="text" id="addform-name" name="name" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-order">排序号</label></td>
                <td><input type="text" id="addform-order" name="order" class="easyui-textbox"
                        data-options="validType:'number'"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-parentId">父级组织</label></td>
                <td><input type="text" id="addform-parentId" name="parentId" value="${parentId}" readonly="readonly" class="easyui-textbox"
                        data-options="validType:'length[0,32]'"/>
                </td>
            </tr>
        </tbody>
    </table>
</form>

<script type="text/javascript">
$(function(){
	var $orgType = $('#addform-orgType').combogrid({
		url: ctx + '/sys/orgrule/list',
		queryParams: {
			parentOrgType: '${parentType}'
		},
		idField: 'childOrgType',
		textField: 'childOrgTypeDesc',
		rownumbers: true,
		fitColumns: true,
		columns: [[
            {title: '组织类型', field: 'childOrgType', sortable: true, width: 100},
            {title: '类型描述', field: 'childOrgTypeDesc', sortable: true, width: 100}
		]]
	});
})
</script>
